---
id: f0ec15b5-77bf-4191-8085-b65453b2fe8d
---
%%===========================================================
%%  UPDATED UML CLASS DIAGRAM (MERMAID SYNTAX)
%%===========================================================

classDiagram

%% MAIN CLASSES
class RPAmanager {
  - modeEnd : string
  - forceStop : boolean
  - execResult : ExecResult
  - sp1 : ScreenProcessManager
  - i1 : inputManager
  - ts1 : taskStorage
  %% - tp1 : taskPrompt
  %% - l1 : LLMmanager
  - f1 : fileManager
  - fdom : fileManager
  - fresult : fileManager
  - ftask : fileManager
  - fcomm : fileManager
  - jtasks : jtaskItem[]
  - lastOperMode : OperMode
  - curOperMode : OperMode
  + constructor(modeMS: MessageSource<string>, Captions: MessageSource<Caption>)
  + main(call: funcCall) : Promise<void>
  + OCRgetTag(imgObj1?: ImgObj) : Promise<ImgObj>
  + changeUImode(from: string, to: string) : Promise<void>
  + UImodeChanged(listenMode: string) : Promise<string>
  + findMatchFun(step: taskstep) : Promise<jtaskItem>
  + ...

}

class UIAgent {
  - Messages : MessageSource<Message>
  - stepsMS : MessageSource<taskstep>
  - historycallsMS : MessageSource<funcCall>
  - gparamsMS : MessageSource<globparam>
  - GlobParamSelect : SelectOption[]
  - showSelect : boolean
  - taskItemState : number
  - auto3step : boolean
  + parseResult(rawstr: string) : any
  + step1gene() : Promise<void>
  + step2Exec(callIndex: number) : Promise<void>
  + step3conclude() : Promise<void>
  + savejtask() : Promise<void>
  + threeSteps(self: number) : Promise<void>
  + ...

}

%% OTHER CLASSES
class AccessibilityManager {
  - static instance : AccessibilityManager
  + static getInstance() : AccessibilityManager
  + currentPageObjs : any[]
  + currentPageElementArray : any[]
  + currentCall : any
  + pageDesc : string
  + pageDescH : string
  + main() : Promise<void>
  + DOMstep(reply: LMreply) : Promise<ExecResult>
  + Navigator() : Promise<void>
  + refreshPageObj(...) : Promise<boolean | void>
  + inputText(str: string, id: number) : Promise<void>
  + findTextInput() : any
  + findKeyBoard() : any
  + getshortPageDesc() : Promise<string>
  + onStop() : void
}

class AccessibilityUtils {
  <<singleton>>
  + static async getAllElementInfoPrint(currentPageElementArray, ElementLevelArray) : string
  + static async getAllElementInfo(currentPageElementArray, getId) : string
  + static async createElementArray(accessibilityElement) : [any, any]
  + static async traceBrotherAttribute(element, attribute) : any
  + static async traceAncestorAttribute(element, attribute) : any
  + static examineOverlap(objs) : boolean
  + static async findClickRect(currentPageElementArray, click, rect, waitTime) : any
  + static async findClickables(currentPageElementArray, getEntrySum) : any
  + static printOneNode(node) : void
  + static async findClickableAns(currentPageElementArray, targetid) : any
  + static scrollDirs(forward) : any
  + static isOverlap(rectA, rectB) : boolean
  + static async EAtoObject(elements, wantedAttributes) : any[]
  + static async findObjFromEle(Objs, element) : any
  + static distill(elementObj, level) : any
  + static getJSONinfo(elementsObj, plainStore) : string
}

%% class LLMmanager {
%%   - dir : string
%%   - filename : string
%%   - mode : string
%%   + constructor(dir, filename, mode)
%%   + async askLLM(infoPrompt : string) : Promise<string>
%%   + async askLLMj(infoPrompt : string) : Promise<LMreply|undefined>
%%   + parseResult(result : string) : string
%%   + parseStreamResult(data : string) : void
%% }

class LLMtaskManager {
  - task : string
  - extraInfo : string
  - taskStatus : string
  - pageDescH : string
  - prompt : string
  - sameCnt : number
  + constructor(dir)
  + getStatusPrompt() : string
  + async getPrompt(pageDescH) : Promise<string>
  + settaskStatus(taskStatus : string) : void
  + print() : void
}

%% class VLMmanager {
%%   - requestOptions : any
%%   + constructor()
%%   + async VLM(imgstr : string, prompt : string, fromBase64 : boolean) : Promise<string>
%%   + parseVLMResult(response : string) : string
%% }

%% class taskPrompt {
%%   + constructor(context: common.UIAbilityContext | AccessibilityExtensionContext)
%%   + createWorkflow(dispspeech: string) : string
%%   + VLMdevPrompt(task: string) : string
%%   + writeSteps(excludeName: string, tracks: taskTrack[]) : Promise<string>
%%   + DOMprompt(taskStr: string, pageDescH: string, extraInfo: string) : string
%%   + tagPrompt(taskStr: string, type: OperMode, ocrPageDesc: string) : string
%%   + tracks4LLM(tracks: taskTrack[], addOperMode: boolean) : string
%%   + funcCall4LLM(call: funcCall) : string
%% }


class taskStorage {
  %% + constructor(context: common.UIAbilityContext | AccessibilityExtensionContext)
  + static currentCall: funcCall
  + static firstOperMode: OperMode
  + static tracks: taskTrack[]
  + pushTrack(track: taskTrack) : Promise<void>
  + getAllTasks() : Promise<taskItem[]>
  + getJTask(targetTaskName: string) : Promise<jtaskItem>
  + getAllJTasks() : Promise<jtaskItem[]>
  + insertTask(taskitem: taskItem) : Promise<void>
  + insertJTask(jtaskitem: jtaskItem) : Promise<void>
  + updateJTask(taskitem: jtaskItem) : Promise<void>
  + mergegparam(originalPs: globparam[], addps: globparam[]) : globparam[]
}

class AccessibilityExtAbility {
  <<extends AccessibilityExtensionAbility>>
  + onConnect() : void
  + onDisconnect() : void
  + onAccessibilityEvent(accessibilityEvent) : void
  + onKeyEvent(keyevent) : boolean
}

%% class AccessibilityConfig {
%%   + enableAEA() : void
%%   + startAEA() : void
%%   + stopAEA() : void
%% }

%% RELATIONSHIPS
RPAmanager --> taskStorage : uses
%% RPAmanager --> taskPrompt : uses
%% RPAmanager --> AccessibilityUtils : uses
RPAmanager --> AccessibilityManager : uses
UIAgent --> RPAmanager : uses
UIAgent --> taskStorage : uses
%% task --> taskPrompt : uses
%% task --> LLMmanager : uses

AccessibilityExtAbility --> AccessibilityManager : uses getInstance()
AccessibilityManager --> AccessibilityUtils : uses
%% AccessibilityManager --> LLMmanager : uses
AccessibilityManager --> LLMtaskManager : uses
%% AccessibilityManager --> VLMmanager : may use
%% AccessibilityUtils --> AccessibilityConfig : calls enabling or other config
%% AccessibilityManager --> taskPrompt : depends on prompts
AccessibilityManager --> taskStorage : reads or updates tasks
%% taskPrompt --> taskStorage : uses

style RPAmanager fill: #E6F7FF
style UIAgent fill: #E6F7FF
style AccessibilityManager fill: #E6F7FF

